%% Erlang compilation

{ erl_opts
, [ debug_info
  , {platform_define, "^2", 'ETS_CAS'}
  , {platform_define, "^(R|1|20)", 'FUN_STACKTRACE'}
  ]
}.

{src_dirs, ["src", "bootstrap"]}.

%% Clojerl compilation

{clje_src_dirs,  ["src/clj"]}.
{clje_test_dirs, ["test/clj"]}.
{clje_compile_first, ["clojure/core.clje"]}.
{ clje_exclude
, [ "clojure/core_print.clje"
  , "clojure/core_deftype.clje"
  , "clojure/core/protocols.clje"
  , "clojure/instant.clje"
  , "clojure/uuid.clje"

  , "clojure/pprint/cl_format.clje"
  , "clojure/pprint/column_writer.clje"
  , "clojure/pprint/dispatch.clje"
  , "clojure/pprint/pprint_base.clje"
  , "clojure/pprint/pretty_writer.clje"
  , "clojure/pprint/print_table.clje"
  , "clojure/pprint/utilities.clje"
  ]
}.

%% Shell

{shell, [{apps, [clojerl]}]}.

%% Dialyzer

{dialyzer, []}.

%% Dependencies

{ deps
, [ {spec_alpha, "0.2.194", {pkg, clje_spec_alpha}}
  , {core_specs_alpha, "0.2.56", {pkg, clje_core_specs_alpha}}
  , {test_check, "1.1.1", {pkg, clje_test_check}}
  ]
}.

%% Remove cyclic dependency

{ overrides
, [{override, test_check, [{deps, []}]}]
}.

%% Plugins

{plugins, [{rebar3_clojerl, "0.8.8"}]}.

%% Profiles

{ profiles,
  [ { docs
    , [ { plugins
        , [ {rebar3_docs, "0.2.1"}
          ]
        }
      ]
    }
  , { dev
    , [ { deps
        , [ {eflame, {git, "https://github.com/jfacorro/eflame", {branch, "various.improvements"}}}
          , {redbug, "1.2.1"}
          ]
        }
      ]
    }
  , { test
    , [ {src_dirs, ["src", "bootstrap", "scripts"]}
      , {erl_opts, [{d, 'COVER'}]}
      , { deps
        , [ {xref_runner, {git, "https://github.com/inaka/xref_runner.git", {tag, "0.2.5"}}}
          , {meck,        {git, "https://github.com/eproxus/meck",          {tag, "0.8.13"}}}
          , { data_generators
            , {git, "https://github.com/clojerl/data.generators", {branch, "clojerl"}}
            }
          , { test_generative
            , {git, "https://github.com/clojerl/test.generative", {branch, "clojerl"}}
            }
          ]
        }
      , { overrides
        , [ {override, data_generators, [{deps, []}]}
          , { override
            , test_generative
            , [ { deps
                , [ { data_generators
                    , {git, "https://github.com/clojerl/data.generators", {branch, "clojerl"}}
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    }
  ]
}.

%% Coverage

{cover_opts, [verbose]}.

%% EDoc

{edoc_opts, [{preprocess, true}]}.

%% rebar3_docs

{ docs
, [ { categories,
      [ { "Basic Types"
        , [ 'clojerl.BitString'
          , 'clojerl.Boolean'
          , 'clojerl.Float'
          , 'clojerl.Fn'
          , 'clojerl.Integer'
          , 'clojerl.Keyword'
          , 'clojerl.Nil'
          , 'clojerl.String'
          , 'clojerl.Symbol'
          , 'erlang.Fn'
          , 'erlang.Port'
          , 'erlang.Process'
          , 'erlang.Reference'
          , 'erlang.Type'
          , 'erlang.util.Date'
          , 'erlang.util.Regex'
          , 'erlang.util.UUID'
          ]
        }
      , { "Namespaces & Vars"
        , [ 'clojerl.Namespace'
          , 'clojerl.Var'
          ]
        }
      , { "Collections & Data Structures"
        , [ 'clojerl.Cons'
          , 'clojerl.Cycle'
          , 'clojerl.Iterate'
          , 'clojerl.LazySeq'
          , 'clojerl.List'
          , 'clojerl.Map'
          , 'clojerl.Range'
          , 'clojerl.Repeat'
          , 'clojerl.Set'
          , 'clojerl.SortedMap'
          , 'clojerl.SortedSet'
          , 'clojerl.TupleMap'
          , 'clojerl.Vector'
          , 'erlang.List'
          , 'erlang.Map'
          , 'erlang.Tuple'
          ]
        }
      , { "Concurrency"
        , [ 'clojerl.Agent'
          , 'clojerl.Atom'
          , 'clojerl.Delay'
          , 'clojerl.Future'
          , 'clojerl.ProcessVal'
          , 'clojerl.Promise'
          ]
        }
      , { "I/O"
        , [ 'erlang.io.File'
          , 'erlang.io.PushbackReader'
          , 'erlang.io.StringReader'
          , 'erlang.io.StringWriter'
          ]
        }
      , { "Errors"
        , [ 'clojerl.ArityError'
          , 'clojerl.AssertionError'
          , 'clojerl.BadArgumentError'
          , 'clojerl.Error'
          , 'clojerl.ExceptionInfo'
          , 'clojerl.IllegalAccessError'
          ]
        }
      , { "Protocols"
        , [ 'clojerl.IAssociative'
          , 'clojerl.IBlockingDeref'
          , 'clojerl.IChunk'
          , 'clojerl.IChunkedSeq'
          , 'clojerl.IColl'
          , 'clojerl.ICounted'
          , 'clojerl.IDeref'
          , 'clojerl.IEncodeClojure'
          , 'clojerl.IEncodeErlang'
          , 'clojerl.IEquiv'
          , 'clojerl.IError'
          , 'clojerl.IExceptionInfo'
          , 'clojerl.IFn'
          , 'clojerl.IHash'
          , 'clojerl.IIndexed'
          , 'clojerl.IKVReduce'
          , 'clojerl.ILookup'
          , 'clojerl.IMap'
          , 'clojerl.IMeta'
          , 'clojerl.INamed'
          , 'clojerl.IOError'
          , 'clojerl.IPending'
          , 'clojerl.IRecord'
          , 'clojerl.IReduce'
          , 'clojerl.IReference'
          , 'clojerl.IReversible'
          , 'clojerl.ISeq'
          , 'clojerl.ISeqable'
          , 'clojerl.ISequential'
          , 'clojerl.ISet'
          , 'clojerl.ISorted'
          , 'clojerl.IStack'
          , 'clojerl.IStringable'
          , 'clojerl.IType'
          , 'clojerl.IVector'
          , 'erlang.io.ICloseable'
          , 'erlang.io.IPushbackReader'
          , 'erlang.io.IReader'
          , 'erlang.io.IWriter'
          ]
        }
      ]
    }
  ]
}.
